package com.beans;

import java.text.SimpleDateFormat;
import java.util.Date;

public class ClaimBaseInfomationBean {
	AdminUserBean adminBean;
	int claimId;
	String claimNum;
	public int getClaimId() {
		return claimId;
	}
	public void setClaimId(int claimId) {
		this.claimId = claimId;
	}
	public String getClaimNum() {
		return claimNum;
	}
	public void setClaimNum(String claimNum) {
		this.claimNum = claimNum;
	}
	
	public ClaimBaseInfomationBean(AdminUserBean adminBean) {
		this.adminBean = adminBean;
	}
	
	public String toJSONString() {
		String applEmpName = adminBean.getUserName();
		if (applEmpName == null) {
			applEmpName = "";
		}

		String applOrgDeptName = adminBean.getDepartment();
		if (applOrgDeptName == null) {
			applOrgDeptName = "";
		}

		String applOrgCompany = adminBean.getDepartment();
		if (applOrgCompany == null) {
			applOrgCompany = "";
		}

		String applJobName = adminBean.getOccupation();
		if (applJobName == null) {
			applJobName = "";
		}

		String applJobCode = "";
		

		String applEmpNo = adminBean.getUserCode();
		if (applEmpNo == null) {
			applEmpNo = "";
		}

		Date currentTime = new Date();
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		String dateString = formatter.format(currentTime);
		String applDate = dateString;
		String applEmail = adminBean.getEmail();
		if (applEmail == null) {
			applEmail = "";
		}
	
		String applPhone = adminBean.getTelephone();
		if (applPhone == null) {
			applPhone = "";
		}
	
		String ouCode = adminBean.getCompany();
		if (ouCode == null) {
			ouCode = "";
		}
		String ouName = adminBean.getCompanyDesc();
		if (ouName == null) {
			ouName = "";
		}

		return "\"applEmpName\":" + "\"" + applEmpName
				+ "\",\"applOrgDeptName\":" + "\"" + applOrgDeptName + "\",\"applJobName\":\"" + applJobName
				+ "\",\"applJobCode\":" + "\"" + applJobCode + "\",\"applEmpNo\":\"" + applEmpNo + "\",\"applDate\":"
				+ "\"" + applDate + "\",\"applEmail\":\"" + applEmail + "\",\"applPhone\":" + "\"" + applPhone
				+ "\",\"ouCode\":" + "\"" + ouCode + "\",\"ouName\":\"" + ouName+"\"";

	}
}
